import request from '@/utils/request'

// 查询消息表列表
export function listMessage (query) {
  return request({
    url: '/platform/message/list',
    method: 'get',
    params: query
  })
}



// 查询消息表详细
export function getMessage (id) {
  return request({
    url: '/platform/message/' + id,
    method: 'get'
  })
}


// 查询最后消息表
export function getLastMessageList (query) {
  return request({
    url: '/platform/message/lastMessageList',
    method: 'get',
    params: query
  })
}


// 查询用户消息表
export function getUserMessageList (query) {
  return request({
    url: '/platform/message/userMessageList',
    method: 'get',
    params: query
  })
}


// 新增消息表
export function sendMessage (data) {
  return request({
    url: '/platform/message/send',
    method: 'post',
    data: data
  })
}

// 新增消息表
export function addMessage (data) {
  return request({
    url: '/platform/message',
    method: 'post',
    data: data
  })
}

// 修改消息表
export function updateMessage (data) {
  return request({
    url: '/platform/message',
    method: 'put',
    data: data
  })
}

// 删除消息表
export function delMessage (id) {
  return request({
    url: '/platform/message/' + id,
    method: 'delete'
  })
}


// 导出消息表
export function exportMessage (query) {
  return request({
    url: '/platform/message/export',
    method: 'get',
    params: query
  })
}

// 获取初始化数据
export function getInitData (dictTypes) {
  return request({
    url: '/platform/message/getInitData/' + dictTypes,
    method: 'get'
  })
}
